/**
 * 
 */
package com.listener;


import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import com.activities.Paginaprincipal;


/**
 * @author Chris
 * 
 */
public class MenuListener implements OnItemClickListener {

    private final ListView lista;

    private final Paginaprincipal mActivity;

    public MenuListener(FragmentActivity mActivity, ListView lista) {

        super();
        this.lista = lista;
        this.mActivity = (Paginaprincipal) mActivity;

    }

    /*
     * (non-Javadoc)
     * @see
     * android.widget.AdapterView.OnItemClickListener#onItemClick(android.widget
     * .AdapterView, android.view.View, int, long)
     */
    @Override
    public void onItemClick(AdapterView<?> adp, View view, int position, long id) {

        Integer idd = (int) lista.getAdapter().getItemId(position);
        mActivity.getLugaresCategorias(idd);

    }
}
